package com.gugee.ins.common.dal.mapper.media;

import com.gugee.common.mapper.GugeeMapper;
import com.gugee.ins.common.model.es.blogger.InsBloggerTaggedBrand;
import com.gugee.ins.common.model.es.media.InsMediaTaggedBlogger;
import com.gugee.ins.common.model.mysql.media.InsRelMediaTaggerUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface InsRelMediaTaggerUserMapper extends GugeeMapper<InsRelMediaTaggerUser> {

    @Select("select b.uid,b.username,b.full_name fullName " +
            "from ins_blogger b left join ins_rel_media_tagger_user u on u.tagger_uid = b.uid " +
            "where u.uid = ${uid} order by u.create_time desc")
    List<InsBloggerTaggedBrand> findTaggedBrandByUid(long uid);


    @Select("select b.uid,b.username,b.full_name fullName,b.is_business isBusiness  from ins_rel_media_tagger_user t left join ins_blogger b on t.tagger_uid = b.uid where t.shortcode = '${shortCode}'")
    List<InsMediaTaggedBlogger> getInsMediaTaggedBloggerByShotCode(String shortCode);
}